package com.ygt.servlet;

import java.io.IOException;

/**
 * @Author ygt
 * @Date 2022/6/19 22:59
 * @Version 1.0
 */
public abstract class HttpServlet {

    public abstract void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException;

    public abstract void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException;

    public void service(HttpServletRequest request,HttpServletResponse response) throws IOException {
        if("GET".equals(request.getMethod())){
            doGet(request,response);
        }else if("POST".equals(request.getMethod())){
            doPost(request,response);
        }
    }
}
